package ControlLayer;
import  ModelLayer.*;
import java.util.*;

/**
 * Write a description of class LoanCtr here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class LoanCtr
{
    // instance variables - replace the example below with your own
    private DVDregister dvdRegister;
    private AddressBook addressBook;

    /**
     * Constructor for objects of class LoanCtr
     */
    public LoanCtr()
    {
        addressBook=AddressBook.getInstance();
        dvdRegister=DVDregister.getInstance();
    }

    public void readLoanName(String name)
    {
        addressBook.readLoanName(name);
    }
    
    public void readLoanTitle(String title)
    {
        dvdRegister.readLoanTitle(title);
    }
    
    public Copy checkTitle(String title, int id)
    {
        return dvdRegister.checkTitle(title, id);
    }
    
    public Person checkPerson(String name)
    {
        return addressBook.checkPerson(name);
    }
       
    public boolean checkCopyAvailable(String title)
    {
        return dvdRegister.checkCopyAvailable(title);
    }
    
    public void createLoan(Person person, Copy copy, String name, String title,int id, String borrowDate, String period)
    {
        addressBook.createLoan(copy, name,id,borrowDate,period);
        dvdRegister.createLoan(person,title,id,borrowDate,period);
    }

    public void returnLoan(String name,String title)
    {
        dvdRegister.returnLoan(name,title);
    }
    
    public void deleteLoan(String name,String title)
    {
        dvdRegister.deleteLoan(name,title);
    }
    
    
    
}
